/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.bestco.bela.EntityClasses;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Bestco
 */
@Entity
@Table(name = "login", catalog = "bela", schema = "")

public class Login implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "username", nullable = false, length = 25)
    private String username;
    @Basic(optional = false)
    @Column(name = "pwd1", nullable = false, length = 25)
    private String pwd1;
    @Column(name = "pwd2", length = 25)
    private String pwd2;
    @JoinColumn(name = "idCredit", referencedColumnName = "idCredit", nullable = false)
    @ManyToOne(optional = false)
    private Creditlevel idCredit;

    public Login() {
    }

    public Login(String username) {
        this.username = username;
    }

    public Login(String username, String pwd1) {
        this.username = username;
        this.pwd1 = pwd1;
    }

    public Login(String username, String pwd1, Creditlevel idCredit) {
        this.username = username;
        this.pwd1 = pwd1;
        this.idCredit = idCredit;
    }

    

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPwd1() {
        return pwd1;
    }

    public void setPwd1(String pwd1) {
        this.pwd1 = pwd1;
    }

    public String getPwd2() {
        return pwd2;
    }

    public void setPwd2(String pwd2) {
        this.pwd2 = pwd2;
    }

    public Creditlevel getIdCredit() {
        return idCredit;
    }

    public void setIdCredit(Creditlevel idCredit) {
        this.idCredit = idCredit;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (username != null ? username.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Login)) {
            return false;
        }
        Login other = (Login) object;
        if ((this.username == null && other.username != null) || (this.username != null && !this.username.equals(other.username))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bestco.lf.EntytiClasses.Login[username=" + username + "]";
    }

}
